<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ page import="org.ifilm.model.User,org.ifilm.util.GeneralConstants"%>

<%
	//TEST TO CHECK WHETHER LOGGED USER IS IN OUR SESSION OR NOT
	User loggedUser = (User)session.getAttribute(GeneralConstants.user);
	
	if (loggedUser != null) {
		response.sendRedirect("/film/homeDraft.jsp");
	}
%>

<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>Login Page</title>
		
		<link href="/film/css/index.css" rel="stylesheet" />
		<link href="/film/bootstrap/css/bootstrap.min.css" rel="stylesheet" media="screen"/>
		<script src="/film/bootstrap/js/jquery.js"></script>
	    <script src="/film/bootstrap/js/bootstrap.min.js"></script>
	    
	    <style>
	      	body {
	        	padding-top: 60px; /* 60px to make the container go all the way to the bottom of the topbar */
	      	}
	    </style>
	</head>
	
	<body>
		<div class="navbar navbar-inverse navbar-fixed-top">
			<div class="navbar-inner">
				<div class="container">
					<a class="brand" href="/film/index.jsp">iFilm</a>
					<ul class="nav pull-right">
						<li><button class="btn btn-success" onclick="parent.location='/film/registerUser.jsp'">Sign Up</button></li>
					</ul>
				</div>
			</div>
		</div>
	
		<div class="container">
	      	<form class="form-signin" method="POST" action="/film/req/user/login">
	        	<h2 class="form-signin-heading">Log in</h2>
	        	<input type="text" name="<%=GeneralConstants.userEmail%>" class="input-block-level" placeholder="Email address">
	        	<input type="password" name="<%=GeneralConstants.userPassword%>" class="input-block-level" placeholder="Password">
	        	<label class="checkbox">
	          		<input type="checkbox" value="remember-me"> Remember me
	        	</label>
	        	<button class="btn btn-large btn-primary" type="submit">Log in</button>
	      	</form>
    	</div>
	</body>
</html>